########################################
#                                      #
#        Makefile for HCT module       #
#                                      #
########################################


obj-m := hct.o

KSRC := /lib/modules/`uname -r`/build
PWD := $(shell pwd)

all:
	wget -c https://gitee.com/anolis/hygon-cloud-kernel/raw/hygon-devel-5.10-v1/drivers/crypto/ccp/hct.c
	make -C $(KSRC) M=$(PWD) modules

clean:
	make -C $(KSRC) M=$(PWD) clean

install:
	if [ ! -d /lib/modules/`uname -r`/extra ] ; then \
		mkdir -p /lib/modules/`uname -r`/extra; \
	fi
	cp ./hct.ko /lib/modules/`uname -r`/extra/ && depmod
